<style>
    .row:not(:last-child){ margin-bottom:10px;}
	.tab-pane > .row{ line-height:25px;}
</style>
<form class="checkoutform ruleForm" action="{:U('update')}" method="post">
	<input type="hidden" name="id" value="{$info['id']}"/>
  <div class="form-group"  data-position="bottom" data-intro="输入规则名称">
    <label class="control-label">规则名</label>
    <input class="form-control" placeholder="请输入规则名称" datatype="*"  nullmsg="规则名称不能为空" errormsg="输入限制为文本" name="name" value="{$info['name']}" type="text">
  </div>
  <div class="form-group"  data-position="bottom" data-intro="选择规则分类" >
    <label class="control-label">规则分类</label>
  	<select class="form-control m-bot15" name="type_id">
    	<option>请选择规则分类</option>
    	<volist name="ruletypelist" id="vo">
        	<option <?php if($vo['id']==$info['type_id']){echo('selected');} ?> value="{$vo.id}">{:getdeepstr($vo['cl'])}{$vo.name}</option>
        </volist>
    </select>
  </div>
  <!--<div class="form-group">
    <label class="control-label">积分类型</label>
  	<select class="form-control m-bot15" name="integralType" datatype="*"  nullmsg="请选择！" id="integralType">
    	<option>请选择积分类型</option>
    	<volist name="integraltypelist" id="vo">
        	<option <?php if($vo['id']==$info['integralType']){echo('selected');} ?>  value="{$vo.id}">{$vo.remark}</option>
        </volist>
    </select>
    <input type="hidden" name="integralTypeName"/>
    <script>
		$("#integralType").change(function(e) {
            $("input[name='integralTypeName']").val($(this).find("option:selected").text());
			console.log($("input[name='integralTypeName']").val());
        });
	</script>
  </div>
  <div class="form-group">
    <label class="control-label">积分数量</label>
  	<input name="integralnum" type="number" placeholder="请输入积分数量" datatype="*"  nullmsg="积分数量不能为空" errormsg="输入限制为文本" class="form-control" value="{$info['integralnum']}"/>
  </div>-->
  <div class="form-group">积分详情</div>
  <section class="panel"  data-position="bottom" data-intro="设置积分详情,可选择填写一个固定的分数，或者是填写一个范围的分数 （注意：如果填写了区间分数，将会以范围分数为标准）" >
        <?php   $source=unserialize($info['source']);   
                $judge=true;							//判断是否有第二个值 ，如有，则是标准值，如无，则是区间
                foreach($source as $v){
                    if(isset($v[1])){ $judge=false;}
                }
        ?>
    	<header class="panel-heading custom-tab">
        	<ul class="nav nav-tabs" role="tablist">
              <li role="presentation" class="{$judge?'active':''}"><a href="#profile" role="tab" data-toggle="tab">固定分数</a></li>
              <li role="presentation" class="{$judge==false?'active':''}"><a href="#home" role="tab" data-toggle="tab">区间分数</a></li>
            </ul>
        </header>
        <div class="panel-body">
        	
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane {$judge==false?'active':''}" id="home">
                    <volist name="integraltypelist" id="vo">
                    	<div class="row"> 
                            <label class="col-sm-3 text-right">{$vo.remark}：</label>
                            <div class="col-sm-4">
                                <input datatype="maxNum" class="form-control intenum input-sm" dataobj="#maxObj-{$i}" id="minObj-{$i}" <?php echo $source[$vo['typename']][1]?'value="'.$source[$vo['typename']][0].'"':''; ?> name="source[{$vo.typename}][0]" max="1000" maxlength="5" placeholder="最小分数" type="number"/>
                            </div>
                            <div class="pull-left text-center">—</div>
                            <div class="col-sm-4">
                                <input datatype="minNum" class="form-control intenum input-sm" dataobj="#minObj-{$i}" id="maxObj-{$i}" <?php echo $source[$vo['typename']][1]?'value="'.$source[$vo['typename']][1].'"':''; ?> name="source[{$vo.typename}][1]" max="1000" maxlength="5"  placeholder="最大分数" type="number"/>
                            </div>
                    	</div>
                    </volist>
                </div>
                
                <div role="tabpanel" class="tab-pane {$judge?'active':''}" id="profile">
                    <volist name="integraltypelist" id="vo">
                    	<div class="row">
                            <label class="col-xs-3 text-right">{$vo.remark}：</label>
                            <div class="col-xs-9">
                                <input class="form-control input-sm" ignore="ignore" value="{$source[$vo['typename']][1]?'':$source[$vo['typename']][0]}" name="inte[{$vo.typename}][]" max="1000" maxlength="5"  placeholder="请输入{$vo.remark}" type="number"/>
                            </div>
                        </div>
                    </volist>
                    
                </div>
            </div>
        </div>
  </section>
  <div class="form-group"  data-position="bottom" data-intro="设置规则备注" >
    <label class="control-label">备注</label>
    <textarea class="form-control" name="remark" cols="50" placeholder="请输入备注" rows="3">{$info['remark']}</textarea>
  </div>
</form>